package com.fz.us.oa.core.entity.com;


import com.fz.us.admin.company.entity.BaseFlowEntity;
import com.fz.us.admin.dict.entity.DictItem;
import com.fz.us.oa.core.entity.common.FileManage;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;

/**
 * Created by ZhuChunXiao on 2017/12/5.
 * 财务模块-费用报销
 */
@Entity
@Table(name="ec_expense")
public class Expense extends BaseFlowEntity {


    private static final long serialVersionUID = 1656532521328314806L;


    /**
     * 报销类别
     */
    private DictItem type;

    /**
     * 报销金额（元）
     */
    private BigDecimal amount;


    /**
     * 费用说明
     */
    private String content;

    /**
     * 发票照片
     * @return
     */
    private List<FileManage> pic;

    /**
     * 其他附件
     * @return
     */
    private List<FileManage> file;

    @ManyToOne(fetch = FetchType.LAZY)
    public DictItem getType() {
        return type;
    }

    public void setType(DictItem type) {
        this.type = type;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_expense_pic", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="picId"))
    public List<FileManage> getPic() {
        return pic;
    }

    public void setPic(List<FileManage> pic) {
        this.pic = pic;
    }

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "ec_expense_file", joinColumns = @JoinColumn(name="id"),inverseJoinColumns = @JoinColumn(name="fileId"))
    public List<FileManage> getFile() {
        return file;
    }

    public void setFile(List<FileManage> file) {
        this.file = file;
    }
}
